
var thispage=1;
var pages;
Menu('type','name','count',thispage);
function Menu(type,name,count,page) {
	$.ajax({
		url: "rj",
		type: "post",
		dataType: "JSON",
		data: {
            one:type,
            two:name,
            three:count,
            page:page,
		},
		success: function(data) {
		    console.log(data);
			show(data);
		},
		error: function(err) {
			console.log(err)
		},
	});
}

function show(data){
    pages=data.pages;
    document.getElementById("tbody").innerHTML="";
for (var i=0;i<data.list.length;i++) {
    createTable(data.list[i].nAME,data.list[i].rOLE_DATE,data.list[i].oPTION1);

}}

function createTable(Username,name,seq){
   var tb= document.getElementById('tbody');  

   var tr =document.createElement('tr');

   var td =document.createElement("td");
   td.innerHTML=Username;
   td.id ="seq"+seq;

   var td1 =document.createElement("td");
   td1.innerHTML=name;

   var td2 =document.createElement("td");
   td2.innerHTML=seq;

   tr.appendChild(td);
   tr.appendChild(td1);
   tr.appendChild(td2);
   tb.appendChild(tr);
}

function Arcalefron(){
    if(thispage-1>0){
        thispage=(thispage-1);
        Menu('type','name','count',thispage);
    }else {
        alert("没有上一页");
    }
}
function Arcalefronnext() {
    if (thispage < pages) {
        thispage = (thispage + 1);
        Menu('type','name','count',thispage);
    } else {
        alert("没有下一页");
    }
}